package com.asia5b.a5mall.order.activity

import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.asia5b.a5bmall.resource.ActCons
import com.asia5b.a5mall.middleware.base.SimpleActivity
import com.asia5b.a5mall.middleware.base.SimpleViewModel
import com.asia5b.a5mall.middleware.model.shop.AbsGoodsModel
import com.asia5b.a5mall.middleware.utils.newDivider
import com.asia5b.a5mall.order.adapter.PlaceGoodListAdapter
import com.asia5b.a5mall.order.databinding.ActivityPlacegoodlistBinding
import kotlinx.android.synthetic.main.activity_placegoodlist.*

/**
 * Created by zhangyuncai on 2020/5/7.
 * 商品清单
 */
@Route(path = ActCons.PlaceGoodListActivity)
class PlaceGoodListActivity : SimpleActivity<SimpleViewModel, ActivityPlacegoodlistBinding>() {
    override val viewModelClazz: Class<SimpleViewModel>
        get() = SimpleViewModel::class.java

    override fun getDataBinding(): ActivityPlacegoodlistBinding {
        return ActivityPlacegoodlistBinding.inflate(layoutInflater)
    }
    override var sIsDark = true
    val mRecyclerView by lazy { rv_placegoodlist }
    val mDatas = arrayListOf<AbsGoodsModel>()
    val mAdapter by lazy { PlaceGoodListAdapter(mDatas) }


    override fun initView() {
        mDatas.clear()
        mDatas.addAll(intent.getSerializableExtra("datas") as ArrayList<AbsGoodsModel>)
        mRecyclerView.run {
            layoutManager = LinearLayoutManager(mActivity)
            adapter = mAdapter
            addItemDecoration(newDivider(mActivity))
        }
    }

    override fun initEvent() {
    }

    override fun initData() {
    }
}